﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListOrganisations.ascx.cs"
    Inherits="ServicesDirectory.UserControl.ListOrganisations" %>

<script type="text/javascript">

	
function IsNumeric(sText)
    {
       var validChars = "0123456789";
       var isNumber=true;
       var key;
     
       for (var i = 0; i < sText.length && isNumber == true; i++) 
          { 
          key = sText.charAt(i); 
          if (validChars.indexOf(key) == -1) 
             {
                     alert('Number Page is not valid');
                 isNumber = false;
             }
          }
       return isNumber;
    }
function SetUniqueRadioButton(current)
{

        for(var i = 0; i < document.forms[0].elements.length; i++) {
        	var elm = document.forms[0].elements[i];
        	if (elm.type == 'radio')
        {
        
        elm.checked = false;
        
        }
        }

	current.checked = true;
}
</script>

<div class="bgManager">
    <div class="TitleManarer">
        Organisation List
    </div>
    <div class="sortList">
        <span>
            <asp:LinkButton runat="server" ID="lbtAll" Text="All"></asp:LinkButton>
        </span>| <span>
            <asp:LinkButton runat="server" ID="lbt09" Text="0-9"></asp:LinkButton>
        </span>| <span>
            <asp:LinkButton runat="server" ID="lbtA" Text="A B C D E"></asp:LinkButton>
        </span>| <span>
            <asp:LinkButton runat="server" ID="lbtF" Text="F G H I J"></asp:LinkButton>
        </span>| <span>
            <asp:LinkButton runat="server" ID="lbtK" Text="K L M N"></asp:LinkButton>
        </span>| <span>
            <asp:LinkButton runat="server" ID="lbtO" Text="O P Q R"></asp:LinkButton>
        </span>| <span>
            <asp:LinkButton runat="server" ID="lbtS" Text="S T U V"></asp:LinkButton>
        </span>| <span>
            <asp:LinkButton runat="server" ID="lbtW" Text="W X Y Z"></asp:LinkButton>
        </span>
    </div>
    <div style="width: 28%; height: 25px; float: right; vertical-align: middle;">
        <asp:Button CssClass="button" runat="server" ID="cmdCreate" Text="Create" />
        <asp:CheckBox runat="server" AutoPostBack="True" ID="chkInActive" Text="Include In-Active" />
    </div>
    <div class="spaceManager">
    </div>
    <div class="contentGrid">
        <div class="hearderGrid">
            <div class="OrganisationHeaderCol1">
                <asp:LinkButton runat="server" ID="lbtOrderOrgName" Text="Organisation Name"></asp:LinkButton>
            </div>
            <div class="OrganisationHeaderCol2">
                Head Office Address Line1</div>
            <div class="OrganisationHeaderCol3">
                PostCode</div>
            <div class="OrganisationHeaderCol4">
                Contact</div>
            <div class="OrganisationHeaderCol5">
                Is Active?</div>
        </div>
        <asp:Repeater runat="server" ID="rptOrganisation" 
            onitemcommand="rptOrganisation_ItemCommand" 
            onitemdatabound="RptOrganisation_ItemDataBound">
            <ItemTemplate>
                <div class="rowGrid">
                    <div class="OrganisationContentCol1">
                        <asp:LinkButton runat="server" ID="lbtOrgName" CommandName="Detail" CommandArgument='<%#Eval("OrgId") %>'
                            Text='<%#Eval("OrgName") %>'></asp:LinkButton></div>
                    <div class="OrganisationContentCol2">
                        <%#Eval("AddressLine1")%></div>
                    <div class="OrganisationContentCol3">
                        <asp:Label runat="server" ID="lblPostCode" Text='<%#Eval("AddressId") %>'></asp:Label></div>
                    <div class="OrganisationContentCol4">
                        <asp:Label runat="server" ID="lblContactName" Text='<%#Eval("ContactId") %>'></asp:Label></div>
                    <div class="OrganisationContentCol5">
                        <asp:Label runat="server" ID="lblIsactive" Text='<%#Eval("IsActive") %>'></asp:Label>
                    </div>
                </div>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <div class="alterRowGrid">
                    <div class="OrganisationContentCol1">
                        <asp:LinkButton runat="server" ID="lbtOrgName" CommandName="Detail" CommandArgument='<%#Eval("OrgId") %>'
                            Text='<%#Eval("OrgName") %>'></asp:LinkButton></div>
                    <div class="OrganisationContentCol2">
                        <%#Eval("AddressLine1")%></div>
                    <div class="OrganisationContentCol3">
                        <asp:Label runat="server" ID="lblPostCode" Text='<%#Eval("AddressId") %>'></asp:Label></div>
                    <div class="OrganisationContentCol4">
                        <asp:Label runat="server" ID="lblContactName" Text='<%#Eval("ContactId") %>'></asp:Label></div>
                    <div class="OrganisationContentCol5">
                        <asp:Label runat="server" ID="lblIsactive" Text='<%#Eval("IsActive") %>'></asp:Label>
                    </div>
                </div>
            </AlternatingItemTemplate>
        </asp:Repeater>
        <div class="spaceManager">
        </div>
        <div class="PagingList">
            <span>
                <asp:Button runat="server" CssClass="backAllList" ID="cmdBackAll" />
            </span><span>
                <asp:Button runat="server" CssClass="backList" ID="cmdBackList" /></span> <span style="padding-left: 5px;">
                    Page</span> <span style="padding-left: 5px;">
                        <asp:TextBox Text="1" runat="server" Width="20px" 
                ID="txtPageNumber"></asp:TextBox></span>
            <span>of</span> <span>
                <asp:Label runat="server" Text="1" ID="lblTotalPage"></asp:Label></span> <span>
                    <asp:Button runat="server" CssClass="nextAll" ID="cmdNextAll" />
                </span><span>
                    <asp:Button runat="server" CssClass="nextList" ID="cmdNext" />
                </span>
        </div>
    </div>
    <div class="spaceManager">
    </div>
</div>
